﻿<UserControl x:Class="VideoEncoder.VideoProfileControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:app="clr-namespace:VideoEncoder"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>


        <Border BorderBrush="#ff444444" BorderThickness="1" CornerRadius="5" Margin="3">
            <StackPanel>
                <TextBlock Text="Set to profile:" Margin="3" />
                <ComboBox x:Name="videoProfileCombo" DisplayMemberPath="Name" Margin="3" />
            </StackPanel>
        </Border>



        <Grid Grid.Row="1">
            <Grid.Resources>
                <app:BitRateConverter x:Key="bitRateConverter" />
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" Grid.Row="0" Text="Key from interval" HorizontalAlignment="Right" Margin="3" />
            <TextBox x:Name="keyframespacing" Grid.Column="1" Grid.Row="0" Text="{Binding Path=KeyFrameSpacing, UpdateSourceTrigger=PropertyChanged}" Margin="3" />
            <TextBlock Grid.Column="2" Grid.Row="0" Text="seconds" Margin="3" />

            <TextBlock Grid.Column="0" Grid.Row="1" Text="Mode" HorizontalAlignment="Right" Margin="3" />
            <ComboBox Grid.Column="1" Grid.Row="1" x:Name="modeCombo" DisplayMemberPath="Text" Margin="3" />

            <TextBlock x:Name="bufferWindowTextBlock" Grid.Column="0" Grid.Row="2" Text="Buffer window" HorizontalAlignment="Right" Margin="3" />
            <TextBox x:Name="bufferWindowTextBox" Grid.Column="1" Grid.Row="2" Text="{Binding Path=BufferWindow, UpdateSourceTrigger=PropertyChanged,Converter={StaticResource bitRateConverter}}" Margin="3" />
            <TextBlock x:Name="bufferWindowSecondsTextBlock" Grid.Column="2" Grid.Row="2" Text="seconds" Margin="3" />

            <TextBlock x:Name="bitrateTextBlock" Grid.Column="0" Grid.Row="3" Text="Bitrate(average)" HorizontalAlignment="Right" Margin="3" />
            <TextBox x:Name="bitrateTextBox" Grid.Column="1" Grid.Row="3" Text="{Binding Path=Bitrate, UpdateSourceTrigger=PropertyChanged ,Converter={StaticResource bitRateConverter}}" Margin="3" />
            <TextBlock x:Name="bitrateDescTextBlock" Grid.Column="2" Grid.Row="3" Text="Kbps" Margin="3" />

            <TextBlock x:Name="peakBitrateTextBlock" Grid.Column="0" Grid.Row="4" Text="Peak Bitrate" HorizontalAlignment="Right" Margin="3" />
            <TextBox x:Name="peakBitrateTextBox" Grid.Column="1" Grid.Row="4" Text="{Binding Path=MaxBitrate, UpdateSourceTrigger=PropertyChanged,Converter={StaticResource bitRateConverter}}" Margin="3" />
            <TextBlock x:Name="peakBitrateDescTextBlock" Grid.Column="2" Grid.Row="4" Text="Kbps" Margin="3" />

            <TextBlock x:Name="qualityTextBlock" Grid.Column="0" Grid.Row="5" Text="Quality" HorizontalAlignment="Right" Margin="3" />
            <Slider x:Name="qualitySlider" Grid.Column="1" Grid.Row="5" Minimum="0" Maximum="100" Value="{Binding Quality}" />
            <TextBox x:Name="qualityTextBox" Grid.Column="2" Grid.Row="5" Text="{Binding Quality}" Margin="3" IsReadOnly="True" />
            
            <TextBlock Grid.Column="0" Grid.Row="6" Text="Codec Presets" HorizontalAlignment="Right" Margin="3" />
            <ComboBox Grid.Column="1" Grid.Row="6" x:Name="codecPresetsCombo" Margin="3" />
            
            <TextBlock Grid.Column="0" Grid.Row="7" Text="Video Complexity" HorizontalAlignment="Right" Margin="3" />
            <ComboBox Grid.Column="1" Grid.Row="7" x:Name="videoComplexityCombo" Margin="3" />
            
            <TextBlock Grid.Column="0" Grid.Row="8" Text="Width" HorizontalAlignment="Right" Margin="3" />
            <TextBox x:Name="widthTextBox" Grid.Column="1" Grid.Row="8" Text="{Binding Path=Width, UpdateSourceTrigger=PropertyChanged}" Margin="3" />
            
            <TextBlock Grid.Column="0" Grid.Row="9" Text="Height" HorizontalAlignment="Right" Margin="3" />
            <TextBox x:Name="heightTextBox" Grid.Column="1" Grid.Row="9" Text="{Binding Path=Height, UpdateSourceTrigger=PropertyChanged}" Margin="3" />
        </Grid>
    </Grid>

</UserControl>
